MySQL table in new page after click php

133

$result = mysqli_query($conn,"SELECT * FROM job ORDER BY `CreatedTime` DESC");


echo "<table border='0' cellpadding='0' cellspacing='0' class='table-fill'> 
<tr>
<th width='250px' position='fixed'>Job Title</th> 
<th width='150px'>Company Name</th>
<th width='100px'>Location</th>
<th>Closing Date</th>
<th>View Job</th>
</tr>";


while($row = mysqli_fetch_array($result) ) {
echo "<tr>";
echo "<td>" . $row['positiontitle'] . "</td>";
echo "<td>" . $row['companyname'] . "</td>";
echo "<td>" . $row['location'] . "</td>";
echo "<td>" . $row['closingdate'] . "</td>";
echo "<td><a href='job_details.php?id=".$row['job_id']."'>View Job</td>";

echo "</tr>";
}



And in job_details.php fetch the details against the id and display the result on that page.

jobdetails.php :

<?php

   $result = mysqli_query($conn,"SELECT * FROM job WHERE job_id = '".$_GET['id']."' ORDER BY `CreatedTime` DESC");

   $jobdetails = mysqli_fetch_assoc($result);

   echo 'Position : '.$jobdetails['positiontitle'].'<br>';
   echo 'Company Name: '.$jobdetails['companyname'].'<br>';
   echo 'Location: '.$jobdetails['location'].'<br>';
   echo 'Closing Date: '.$jobdetails['closingdate'].'<br>';


?>

Comments

Submit
0 Comments